package com.example.demo.controller;


import com.example.demo.entity.Test1;
import com.example.demo.service.updateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class updateController {
    @Autowired
    updateService updateservice;


    @ResponseBody
    public String test(){
        return "hello ";
    }

    @RequestMapping("/update")
    @ResponseBody
    public String update(Test1 test){
        updateservice.update(test);
        return "success";
    }

    @RequestMapping("/add")
    @ResponseBody
    public String add(Test1 addtest){
        updateservice.add(addtest);
        return "success1";
    }

    @RequestMapping("/del")
    @ResponseBody
    public String del(Test1 deltest){
        updateservice.del(deltest);
        return "success2";
    }
}
